<template>
    <div class="tof_tasklist">
        <div class="left_side">
            <el-checkbox class="title" v-model="checktree" @change="checkAll">测试项目{{ defaultCheckedKeys }}</el-checkbox>

            <!-- <el-radio-group v-model="testlist">
                    <el-radio-button v-for="test in testall" :label="test.id" :key="test.id">{{ test.name }}</el-radio-button>
                </el-radio-group> -->

            <!-- <el-button type="primary" @click="starttest">Start Testing</el-button> -->

            <el-tree  class="test_list" :data="testall" show-checkbox  node-key="id" ref="tree" :props="defaultProps"
                    @node-click="handleNodeClick" @check-change="handleCheckChange" :default-checked-keys="defaultCheckedKeys">
                </el-tree>
        </div>
        <!-- <div class="left_side_bottom">
                <el-button type="primary">开始任务</el-button>
                <el-button type="danger">设备回零</el-button>
        </div> -->
        <div class="center_side">
            <!-- {{ testlist }} -->
            <div class="testitem">
                <div class="span_title">测试图卡：</div>
                <el-select v-model="test[testlist]['card']">
                    <el-option v-for="item in cardall" :key="item.id" :label="item.card_name" :value="item.id">
                    </el-option>
                </el-select>
            </div>

            <div v-if="this.testlist != 4 && this.testlist != 6">
                <div class="testitem">
                    <div class="span_title">HFOV(°)：</div><el-input v-model="test[testlist]['HFOV']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">VFOV(°)：</div><el-input v-model="test[testlist]['VFOV']"></el-input>
                </div>
            </div>

            <div v-if="this.testlist != 4">
                <div class="testitem_double">
                    <div class="title">图卡位置：</div>
                    <div class="testitem">
                        <div class="span_title">·区间相对下限(m)：</div><el-input v-model="test[testlist]['mindis']">
                        </el-input>
                    </div>
                    <div class="testitem">
                        <div class="span_title">·区间相对上限(m)：</div><el-input
                            v-model="test[testlist]['maxdis']"></el-input>
                    </div>
                </div>

                <div class="testitem">
                    <div class="span_title">强度筛选下限：</div><el-input v-model="test[testlist]['thresh']"></el-input>
                </div>
            </div>
            <div v-if="this.testlist == 6">
                <div class="testitem">
                    <div class="span_title">水平旋转角度(°)：</div><el-input
                        v-model="test[testlist]['horizontal_angle']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">初始Yaw角(°)：</div><el-input v-model="test[testlist]['yaw']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">垂直旋转角度(°)：</div><el-input
                        v-model="test[testlist]['vertical_angle']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">初始化Pitch角（°）：</div><el-input v-model="test[testlist]['pitch']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">测试距离（m）：</div><el-input v-model="test[testlist]['distance']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">循环次数：</div><el-input v-model="test[testlist]['count']"></el-input>
                </div>

            </div>
            <div v-if="this.testlist < 3">

                <div class="testitem">
                    <div class="span_title">要求精度(m)：</div><el-input
                        v-model="test[testlist]['require_accuracy']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">要求准度(m)：</div><el-input
                        v-model="test[testlist]['require_precision']"></el-input>
                </div>

                <div class="testitem">
                    <div class="span_title">测试视场</div>

                    <el-select v-model="test[testlist]['testfov']">
                        <el-option v-for="item in fov_list" :key="item.value" :label="item.label" :value="item.value">
                        </el-option>
                    </el-select>

                </div>
                <div class="testitem">
                    <div class="span_title">测试距离下限（m）</div><el-input v-model="test[testlist]['downstep']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">测试距离上限（m）</div><el-input v-model="test[testlist]['upstep']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">移动步进（m）</div><el-input v-model="test[testlist]['step']"></el-input>
                </div>


            </div>
            <div v-if="this.testlist < 4">
                <div class="testitem">
                    <div class="span_title">水平角分辨率(°)：</div><el-input v-model="test[testlist]['R_H']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">垂直角分辨率(°)：</div><el-input v-model="test[testlist]['R_V']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">拍摄分析帧数：</div><el-input v-model="test[testlist]['laser_ladar']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">分析区域大小：</div><el-input v-model="test[testlist]['test_num']"></el-input>
                </div>
            </div>
            <div v-if="this.testlist == 3 || this.testlist == 4">

                <div class="testitem">
                    <div class="span_title">测试距离(m)：</div><el-input v-model="test[testlist]['distance']"></el-input>
                </div>


            </div>
            <div v-if="this.testlist == 7">
                <div class="testitem">
                    <div class="span_title">拍摄分析帧数：</div><el-input v-model="test[testlist]['laser_ladar']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">测试距离（m）：</div><el-input v-model="test[testlist]['distance']"></el-input>
                </div>

            </div>
            <div v-if="this.testlist == 4">
                <div class="testitem">
                    <div class="span_title">边缘检测区域范围(°)：</div><el-input
                        v-model="test[testlist]['regionlim']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">水平移动步进(°)：</div><el-input
                        v-model="test[testlist]['horizontal_step']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">水平角度左下限(°)：</div><el-input
                        v-model="test[testlist]['horizontal0']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">水平角度左上限(°)：</div><el-input
                        v-model="test[testlist]['horizontal1']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">水平角度右下限(°)：</div><el-input
                        v-model="test[testlist]['horizontal2']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">水平角度右上限(°)：</div><el-input
                        v-model="test[testlist]['horizontal3']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">垂直移动步进(°)：</div><el-input
                        v-model="test[testlist]['vertical_step']"></el-input>
                </div>


                <div class="testitem">
                    <div class="span_title">垂直角度上上限(°)：</div><el-input
                        v-model="test[testlist]['vertical_step0']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">垂直角度上下限(°)：</div><el-input
                        v-model="test[testlist]['vertical_step1']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">垂直角度下上限(°)：</div><el-input
                        v-model="test[testlist]['vertical_step2']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">垂直角度下下限(°)：</div><el-input
                        v-model="test[testlist]['vertical_step3']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">循环次数：</div><el-input v-model="test[testlist]['count']"></el-input>
                </div>


            </div>
            <div v-if="this.testlist == 5">
                <div class="testitem">
                    <div class="span_title">测试距离（m）：</div><el-input v-model="test[testlist]['distance']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">水平移动步进(°)：</div><el-input
                        v-model="test[testlist]['horizontal_step']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">垂直移动步进(°)：</div><el-input
                        v-model="test[testlist]['vertical_step']"></el-input>
                </div>

                <div class="testitem">
                    <div class="span_title">水平移动角度限制(°)：</div><el-input
                        v-model="test[testlist]['horizontal_angle']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">垂直移动角度限制(°)：</div><el-input
                        v-model="test[testlist]['vertical_angle']"></el-input>
                </div>
                <div class="testitem">
                    <div class="span_title">行列变化数：</div><el-input
                        v-model="test[testlist]['vertical_column']"></el-input>
                </div>


            </div>

        </div>
        <div class="right_side">

            <div class="right_top">

                <div class="test_echat">
                    <div class="title">测试数据</div>
                    <div class="echat_inner">

                        <div id="myChart2" style="width: 100%; height: 400px;"></div>


                    </div>
                </div>
                <div class="test_table">
                    <div class="title">数据表</div>
                    <div class="table_inner">
                        <div v-show="this.testlist < 4 || this.testlist == 7">
                            <el-table :data="tableData" border style="width: 100%" height="350">
                                <el-table-column prop="id" label="项次" width="80">
                                </el-table-column>
                                <el-table-column v-if="this.testlist < 4" prop="Position" label="位置（m）">
                                </el-table-column>

                                <el-table-column v-if="this.testlist < 3" prop="POD_lately" width="185"
                                    label="PoD > 50%最近距离">
                                </el-table-column>


                                <el-table-column v-if="this.testlist == 3" prop="precision" width="89" label="精度">
                                </el-table-column>
                                <el-table-column v-if="this.testlist == 3" prop="accuracy" width="89" label="准度">
                                </el-table-column>
                                
                                <el-table-column v-if="this.testlist == 7" prop="flatness" width="120" label="平面度P(m)">
                                </el-table-column>
                                <el-table-column v-if="this.testlist == 7" prop="position" width="154" label="位置">
                                </el-table-column>


                            </el-table>
                        </div>

                        <div v-show="this.testlist == 4">
                            <el-table :data="tableData4" border style="width: 100%" height="71">
                                <el-table-column prop="position" width="110" label="">
                                </el-table-column>
                                <el-table-column prop="level" width="129" label="水平">
                                </el-table-column>
                                <el-table-column prop="perpendicularity" width="130" label="垂直">
                                </el-table-column>
                            </el-table>
                        </div>
                        <div v-show="this.testlist == 6">
                            <el-table :data="tableData6" border style="width: 100%" height="71">
                               
                                <el-table-column prop="position" width="150" label="方向">
                                </el-table-column>
                                <el-table-column prop="level" width="109" label="水平">
                                </el-table-column>
                                <el-table-column prop="perpendicularity" width="110" label="垂直">
                                </el-table-column>
                            </el-table>
                        </div>
                        <div v-show="this.testlist == 5">
                            <el-table :data="tableData5" border style="width: 100%" height="350">
                                <el-table-column prop="FieldOfView" width="49" label="角度">
                                </el-table-column>
                                <el-table-column prop="HorizontalResolution" width="80" label="水平分辨率">
                                </el-table-column>
                                <el-table-column prop="HorizontalResolution_deviation" width="80" label="与要求偏差值">
                                </el-table-column>
                                <el-table-column prop="VerticalResolution" width="80" label="垂直分辨率">
                                </el-table-column>
                                <el-table-column prop="VerticalResolution_deviation" width="80" label="与要求偏差值">
                                </el-table-column>
                            </el-table>
                        </div>
                    </div>

                </div>
                <!-- <img src="static/pod.png"> -->


            </div>
            <div class="right_result">
                <div class="title">测试结果</div>
                <div class="result_inner">
                    <div v-show="this.testlist < 3">
                        <el-table :data="tableData1" border height="330">
                            <el-table-column prop="FieldPosition" label="视场位置" width="180">
                            </el-table-column>
                            <el-table-column prop="POD" label="POD" width="120">
                            </el-table-column>

                            <el-table-column label="图卡位置">
                                <el-table-column prop="CL" label="CL" width="110">
                                </el-table-column>
                                <el-table-column prop="CR" label="CR" width="110">
                                </el-table-column>
                            </el-table-column>
                            <el-table-column label="雷达位置">

                                <el-table-column prop="Roll" label="Roll" width="110">
                                </el-table-column>
                                <el-table-column prop="Yall" label="Yall" width="110">
                                </el-table-column>
                                <el-table-column prop="Pitch" label="Pitch" width="110">
                                </el-table-column>
                                <el-table-column prop="Z" label="Z" width="105">
                                </el-table-column>

                            </el-table-column>
                        </el-table>
                    </div>
                    <div v-show="this.testlist == 3">
                        <el-table :data="tableData3" border height="330">


                            <el-table-column prop="FieldPosition" label="视场" width="117">
                            </el-table-column>



                            <el-table-column prop="TopLeftAngle" label="1 左上视角" width="93">
                            </el-table-column>
                            <el-table-column prop="MiddleUpperAngle" label="2 中上视角" width="93">
                            </el-table-column>
                            <el-table-column prop="TopRightView" label="3 右上视角" width="93">
                            </el-table-column>
                            <el-table-column prop="LeftCenterAngle" label="4 左中视场" width="93">
                            </el-table-column>
                            <el-table-column prop="CenterView" label="5 中心视场" width="93">
                            </el-table-column>
                            <el-table-column prop="RightCenterAngleOfView" label="6 右中视场" width="93">
                            </el-table-column>
                            <el-table-column prop="LowerLeftAngle" label="7 左下视场" width="93">
                            </el-table-column>
                            <el-table-column prop="MiddleDownAngleOfView" label="8 中下视场" width="93">
                            </el-table-column>
                            <el-table-column prop="LowerRightAngleOfView" label="9 右下视场" width="93">
                            </el-table-column>

                        </el-table>
                    </div>
                    <div v-show="this.testlist == 7">
                        <el-table :data="tableData7" border height="330">


                            <el-table-column prop="FieldOfView" label="视场" width="117">
                            </el-table-column>



                            <el-table-column prop="TopLeftAngle" label="1 左上视角" width="93">
                            </el-table-column>
                            <el-table-column prop="MiddleUpperAngle" label="2 中上视角" width="93">
                            </el-table-column>
                            <el-table-column prop="TopRightView" label="3 右上视角" width="93">
                            </el-table-column>
                            <el-table-column prop="LeftCenterAngle" label="4 左中视场" width="93">
                            </el-table-column>
                            <el-table-column prop="CenterView" label="5 中心视场" width="93">
                            </el-table-column>
                            <el-table-column prop="RightCenterAngleOfView" label="6 右中视场" width="93">
                            </el-table-column>
                            <el-table-column prop="LowerLeftAngle" label="7 左下视场" width="93">
                            </el-table-column>
                            <el-table-column prop="MiddleDownAngleOfView" label="8 中下视场" width="93">
                            </el-table-column>
                            <el-table-column prop="LowerRightAngleOfView" label="9 右下视场" width="93">
                            </el-table-column>

                        </el-table>
                    </div>
                    <div v-show="this.testlist == 6">
                        <el-table class='fovdata' border :data="tableData61" height="280">
                            <el-table-column prop="CycleNumber" width="199" label="循环次数">
                            </el-table-column>
                            <el-table-column prop="Direction" label="方向" width="237">
                            </el-table-column>
                            <el-table-column prop="level" label="水平" width="120">
                            </el-table-column>
                            <el-table-column prop="perpendicularity" label="垂直" width="120">
                            </el-table-column>



                        </el-table>
                    </div>
                    <div v-show="this.testlist == 4">
                        <div class="both_title">
                            <span>
                                视场角水平
                            </span>
                            <span>
                                视场角垂直
                            </span>
                        </div>
                        <el-table class='fovdata' border :data="tableData41" height="280">
                            <el-table-column prop="FieldAngle_left" label="左转" width="95">
                            </el-table-column>
                            <el-table-column prop="FieldAngle_right" label="右转" width="95">
                            </el-table-column>
                            <el-table-column prop="BetaAngle" label="测试板" width="95">
                            </el-table-column>
                            <el-table-column prop="HFOV" label="HFOV" width="190">
                            </el-table-column>


                        </el-table>

                        <el-table class='fovdata' border :data="tableData42" height="280">
                            <el-table-column prop="FieldAngle_up" label="上转" width="95">
                            </el-table-column>
                            <el-table-column prop="FieldAngle_down" label="下转" width="95">
                            </el-table-column>
                            <el-table-column prop="BetaAngle" label="测试板" width="95">
                            </el-table-column>

                            <el-table-column prop="VFOV" label="VFOV" width="190">
                            </el-table-column>

                        </el-table>

                    </div>
                    <div v-show="this.testlist == 5">
                        <el-table :data="tableData51" border height="255">


                            <el-table-column prop="FieldOfView" label="[水平方向] 角度" width="125">
                            </el-table-column>



                            <el-table-column prop="TopLeftAngle" label="1 左上视角" width="92">
                            </el-table-column>
                            <el-table-column prop="MiddleUpperAngle" label="2 中上视角" width="92">
                            </el-table-column>
                            <el-table-column prop="TopRightView" label="3 右上视角" width="92">
                            </el-table-column>
                            <el-table-column prop="LeftCenterAngle" label="4 左中视场" width="92">
                            </el-table-column>
                            <el-table-column prop="CenterView" label="5 中心视场" width="92">
                            </el-table-column>
                            <el-table-column prop="RightCenterAngleOfView" label="6 右中视场" width="92">
                            </el-table-column>
                            <el-table-column prop="LowerLeftAngle" label="7 左下视场" width="92">
                            </el-table-column>
                            <el-table-column prop="MiddleDownAngleOfView" label="8 中下视场" width="92">
                            </el-table-column>
                            <el-table-column prop="LowerRightAngleOfView" label="9 右下视场" width="93">
                            </el-table-column>

                        </el-table>
                        <el-table :data="tableData52" border height="250">


                            <el-table-column prop="FieldOfView" label="[水平方向] 角度" width="125">
                            </el-table-column>



                            <el-table-column prop="TopLeftAngle" label="1 左上视角" width="92">
                            </el-table-column>
                            <el-table-column prop="MiddleUpperAngle" label="2 中上视角" width="92">
                            </el-table-column>
                            <el-table-column prop="TopRightView" label="3 右上视角" width="92">
                            </el-table-column>
                            <el-table-column prop="LeftCenterAngle" label="4 左中视场" width="92">
                            </el-table-column>
                            <el-table-column prop="CenterView" label="5 中心视场" width="92">
                            </el-table-column>
                            <el-table-column prop="RightCenterAngleOfView" label="6 右中视场" width="92">
                            </el-table-column>
                            <el-table-column prop="LowerLeftAngle" label="7 左下视场" width="92">
                            </el-table-column>
                            <el-table-column prop="MiddleDownAngleOfView" label="8 中下视场" width="92">
                            </el-table-column>
                            <el-table-column prop="LowerRightAngleOfView" label="9 右下视场" width="93">
                            </el-table-column>

                        </el-table>
                    </div>
                </div>






            </div>
            <div class="right_img">
                <div class="title">视场位置</div>
                <!-- </div> -->
                <el-table class='tablefov' :data="tablefov" border height="145">
                    <el-table-column prop="value0" width="115" label="1 左上视角">
                    </el-table-column>
                    <el-table-column prop="value1" width="115" label="2 中上视角">
                    </el-table-column>
                    <el-table-column prop="value2" width="116" label="3 右上视角">
                    </el-table-column>
                </el-table>
            </div>


        </div>
        <el-dialog title="测试参数" :visible.sync="if_saveparameter" :before-close="handleClose_is_lightcreate">
            <el-form>
                <h3>保存任务名称:<el-input v-model="auto_task_name"></el-input></h3>
                <!-- <h3>test_num:<el-input></el-input></h3> -->


            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="if_saveparameter = false">取 消</el-button>
                <el-button type="primary" @click="saveparameter">确 定</el-button>
            </div>
        </el-dialog>
        <div class="right_bottom">

            <!-- <el-button type="primary" @click="cmslocation()">设置</el-button> -->
            <!-- <el-button type="primary" class="fr" @click="ImportParameter()">导入参数</el-button> -->
            <el-select v-model="test_value" placeholder="请选择" class="fr" @change="ImportParameter()">
                <el-option v-for="item in test_options" :key="item.id" :label="item.auto_task_name" :value="item.id" >
                </el-option>
            </el-select>
            <el-button type="primary" class="fr" @click="if_saveparameter = true">保存当前参数</el-button>
            <el-button type="success" class="fr">导出结果</el-button>
            <el-button type="primary" class="fr" @click="start_one_task()">开始任务</el-button>




            <!-- <div class="fr title">步进</div> -->

            <!-- <div class="fr title">轴移动:</div> -->

        </div>
    </div>

</template>
<script>
// Vue.prototype.$echarts = echarts
export default {
    data() {
        return {
            defaultCheckedKeys: [],
            auto_task_name: '',
            if_saveparameter: false,
            checktree: false,
            guide_value: 1,
            test_value: '',
            defaultProps: {
                id: 'id',
                children: 'children',
                label: 'name'
            },
            options: [
                { 'value': 1, 'label': 1 },
                { 'value': 0.1, 'label': 0.1 },
                { 'value': 10, 'label': 10 },
                { 'value': 100, 'label': 100 },
            ],
            test_options: [

            ],
            cardlist: [],
            cmclocation: false,
            testlist: 1,
            myChart2: '',
            test: [
                {}, {}, {}, {}, {}, {}, {},

            ],
            testfov: 0,
            fov_list: [
                { 'value': 0, 'label': '九宫格' },
                { 'value': 1, 'label': '当前位置' },
            ],
            testall: [{ id: 1, name: '1,测远能力', label: 'distancetest' },
            { id: 2, name: '2,测近能力', label: 'distancetest' },
            { id: 3, name: '3,测距精准度', label: 'DisAPtest' },
            { id: 4, name: '4,视场角', label: 'FovTest' },

            { id: 5, name: '5,角度分辨率', label: 'ResolutionAngle' },
            { id: 6, name: '6,角度准度', label: 'AccuracyPlane' },
            { id: 7, name: '7,平面度', label: 'AccuracyPlane' }],
            tableData: [
                {
                    'id': 1, 'xline': '左上视角', 'yline': 40
                },
                {
                    'id': 2, 'xline': '上中视角', 'yline': 50
                },
                {
                    'id': 3, 'xline': '右上视角', 'yline': 60
                },
                {
                    'id': 4, 'xline': '左中视角', 'yline': 70
                },
                {
                    'id': 5, 'xline': '中心视场', 'yline': 80
                },
                {
                    'id': 6, 'xline': '右中视场', 'yline': 90
                },
                {
                    'id': 7, 'xline': '左下视场', 'yline': 90
                },
                {
                    'id': 8, 'xline': '下中视场', 'yline': 90
                }, {
                    'id': 9, 'xline': '右下视场', 'yline': 90
                }

            ],
            tableData71: [
                {
                    'id': 1, 'xline': '左上视角', 'yline': 40
                },
                {
                    'id': 2, 'xline': '上中视角', 'yline': 50
                },
                {
                    'id': 3, 'xline': '右上视角', 'yline': 60
                },
                {
                    'id': 4, 'xline': '左中视角', 'yline': 70
                },
                {
                    'id': 5, 'xline': '中心视场', 'yline': 80
                },
                {
                    'id': 6, 'xline': '右中视场', 'yline': 90
                },
                {
                    'id': 7, 'xline': '左下视场', 'yline': 90
                },
                {
                    'id': 8, 'xline': '下中视场', 'yline': 90
                }, {
                    'id': 9, 'xline': '右下视场', 'yline': 90
                }

            ],
            tableData5: [
                {
                    'id': 1, 'angle': '左上视角', 'line': 40
                },
                {
                    'id': 2, 'angle': '上中视角', 'line': 50
                },
                {
                    'id': 3, 'angle': '右上视角', 'line': 60
                },
                {
                    'id': 4, 'angle': '左中视角', 'line': 70
                },
                {
                    'id': 5, 'angle': '中心视场', 'line': 80
                },
                {
                    'id': 6, 'angle': '右中视场', 'line': 90
                },
                {
                    'id': 7, 'angle': '左下视场', 'line': 90
                },
                {
                    'id': 8, 'angle': '下中视场', 'line': 90
                }, {
                    'id': 9, 'angle': '右下视场', 'line': 90
                }

            ],
            tableData1: [
                { 'distance': '左上视角' }, { 'distance': '左上视角' }, { 'distance': '左上视角' }, { 'distance': '当前视角' }
            ],
            tableData4: [{
                'distance': '视场角（°）', 'province': 1
            },],
            tableData6: [{
                'distance': '角度准度偏差（°）', 'province': 1
            },],
            tableData61: [{
                'wasd': '实际转轴旋转角度',
                'count': '1'
            }, {
                'wasd': '雷达坐标中旋转角度',
                'count': '1'
            }, {
                'wasd': '实际转轴旋转角度',
                'count': '2'
            }, {
                'wasd': '雷达坐标中旋转角度',
                'count': '2'
            }],
            tableData3: [
                {
                    'distance': '测试准度（m）', 'province': 1
                }, {
                    'distance': '测试精度（m）', 'province': 1
                }
            ],
            tableData7: [
                {
                    'distance': '平面度P(m)', 'province': 1
                },
            ],
            tableData51: [
                {
                    'distance': '初始角度', 'province': 1
                }, {
                    'distance': '终止角度', 'province': 1
                }, {
                    'distance': '行列变化数', 'province': 1
                }, {
                    'distance': '测试板张角', 'province': 1
                }
            ],
            tableData52: [
                {
                    'distance': '初始角度', 'province': 1
                }, {
                    'distance': '终止角度', 'province': 1
                }, {
                    'distance': '行列变化数', 'province': 1
                }, {
                    'distance': '测试板张角', 'province': 1
                }
            ],
            tableData41: [
                { 'count': 1 }, { 'count': 2 }, { 'count': 3 }, { 'count': 4 }, { 'count': 5 }
            ],
            tableData42: [
                { 'count': 1 }, { 'count': 2 }, { 'count': 3 }, { 'count': 4 }, { 'count': 5 }
            ],
            xline: [4, 5, 6, 7, 8, 9],
            yline: ['40', '50', '60', '70', '80', '90'],
            tablefov: [{ value0: '3 左中视角', value1: '4 中心视角', value2: '5 右中视角' }, { value0: '7 左下视角', value1: '8 中下视角', value2: '9 右下视角' }],
            cardall: [],
        };

    },
    mounted: function () {
        this.drawLine1()
    },
    methods: {
        handleClose_is_lightcreate(done) {
            this.$confirm('确认关闭？')
                .then(_ => {
                    done();
                })
                .catch(_ => {
                });
        },
        ImportParameter() {
            this.$axios.patch(this.$settings.BASE_URL_TOF + `tof_task/TaskDefaultParameter/1/`, {
                'auto_task_argument': this.test_value
            }).then((res) => {
                console.log('TaskDefaultParameter',res.data)
                if (res.data.code == 100) {
                    this.GetTaskAutomateArgument(this.test_value)
                    // this.get_at_present_card()
                }
                else {
                    this.$message.error(res.data.msg);
                }
            })
        },
        handleCheckAllChange(val) {
            if (val) {
                this.$refs.tree.setCheckedNodes(this.testall);
                console.log('++++++++',this.$refs.tree,'-----------------')
            } else {
                this.$refs.tree.setCheckedNodes([]);
            }
        },
        saveparameter() {
            this.$axios.post(this.$settings.BASE_URL_TOF + `tof_task/TaskAutomateArgument/`, {
                'auto_task_name': this.auto_task_name,
                'auto_task_mate': this.test
            }).then((res) => {
                if (res.data.code == 100) {
                    this.GetTaskAuto()
                    this.if_saveparameter = false
                    // this.get_at_present_card()
                }
                else {
                    this.$message.error(res.data.msg);
                }
            })
        },
        // 获取当前参数 TaskAutomateArgument test
        GetTaskAutomateArgument(id) {
            this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAutomateArgument/${id}/`).then((res) => {
                if (res.data.code == 100) {
                    this.test = res.data.data['auto_task_mate']
                    // this.get_at_present_card()
                }
                else {
                    this.$message.error(res.data.msg);
                }
            })
        },
        // test_value
        GetTaskDefaultParameter() {
            this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskDefaultParameter/1/`).then((res) => {
                if (res.data.code == 100) {
                    this.test_value = res.data.data['auto_task_argument']
                    this.GetTaskAutomateArgument(this.test_value)
                    // this.get_at_present_card()
                }
                else {
                    this.$message.error(res.data.msg);
                }
            })
        },
        // test_options
        GetTaskAuto() {
            this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAutomateArgumentName/`).then((res) => {
                if (res.data.code == 100) {
                    this.test_options = res.data.data
                    // this.get_at_present_card()
                }
                else {
                    this.$message.error(res.data.msg);
                }
            })
        },
        GetCard() {
            this.$axios.get(this.$settings.BASE_URL_TOF + `tof_chart/ListCard/`).then((res) => {
                if (res.data.code == 100) {
                    console.log('------', res.data.data)
                    this.cardall = res.data.data
                    // this.get_at_present_card()
                }
                else {
                    this.$message.error(res.data.msg);
                }
            })
        },
        start_one_task() {
            this.$axios.post(this.$settings.BASE_URL_TOF + `tof_task/StartTask/`, {
                'id': this.defaultCheckedKeys
            }).then((res) => {

            })
        },
        GetTaskAnalyzeAllDistanceFinding() {
            this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllDistanceFinding/`,).then((res) => {
                if (res.data.code == 100) {
                    this.tableData1 = res.data.data
                    // this.get_at_present_card()
                }
                else {
                    this.$message.error(res.data.msg);
                }
            })
        },
        GetDataModels() {
            this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllDistanceFindingData/`,).then((res) => {
                if (res.data.code == 100) {
                    this.tableData = res.data.data
                }
                else {
                    this.$message.error(res.data.msg);
                }
            })
        },
        handleNodeClick(data, checked, indeterminate) {
            this.testlist = data.id
            console.log(data.id)
            if (data.id == 1) {
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllDistanceFinding/`,).then((res) => {
                    if (res.data.code == 100) {
                        this.tableData1 = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllDistanceFindingData/`,).then((res) => {
                    if (res.data.code == 100) {
                        this.tableData = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
            } else if (data.id == 2) {
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllProximityMeasurement/`,).then((res) => {
                    if (res.data.code == 100) {
                        this.tableData1 = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllProximityMeasurementData/`,).then((res) => {
                    if (res.data.code == 100) {
                        this.tableData = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
            } else if (data.id == 3) {
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllRangeAccuracy/`,).then((res) => {
                    if (res.data.code == 100) {
                        this.tableData3 = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllRangeAccuracyData/`,).then((res) => {
                    if (res.data.code == 100) {
                        this.tableData = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
            } else if (data.id == 4) {
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllFieldAnglePerpendicularity/`,).then((res) => {
                    if (res.data.code == 100) {
                        console.log(res.data.data)
                        this.tableData42 = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllFieldAngleLevel/`,).then((res) => {
                    if (res.data.code == 100) {
                        this.tableData41 = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllFieldAnglePerpendicularityData/`,).then((res) => {
                    if (res.data.code == 100) {
                        this.tableData4 = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
            } else if (data.id == 5) {
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllAngularResolutionLevel/`,).then((res) => {
                    if (res.data.code == 100) {
                        console.log(res.data.data)
                        this.tableData51 = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllAngularResolutionPerpendicularity/`,).then((res) => {
                    if (res.data.code == 100) {
                        this.tableData52 = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllAngularResolution/`,).then((res) => {
                    if (res.data.code == 100) {
                        this.tableData5 = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
            } else if (data.id == 6) {
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllAngularAccuracy/`,).then((res) => {
                    if (res.data.code == 100) {
                        console.log(res.data.data)
                        this.tableData61 = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllAngularAccuracyData/`,).then((res) => {
                    if (res.data.code == 100) {
                        this.tableData6 = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
            } else if (data.id == 7) {
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllflatness/`,).then((res) => {
                    if (res.data.code == 100) {
                        console.log(res.data.data)
                        this.tableData7 = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
                this.$axios.get(this.$settings.BASE_URL_TOF + `tof_task/TaskAnalyzeAllflatnessData/`,).then((res) => {
                    if (res.data.code == 100) {
                        this.tableData = res.data.data
                    }
                    else {
                        this.$message.error(res.data.msg);
                    }
                })
            }
        },
        handleCheckChange(checkedNodes, checkedKeys){
            const id = checkedNodes.id;
      const index = this.defaultCheckedKeys.indexOf(id);

      if (index === -1) {
        this.defaultCheckedKeys.push(id);
      } else {
        this.defaultCheckedKeys.splice(index, 1);
      }

      this.$refs.tree.setCheckedKeys(this.defaultCheckedKeys);
      console.log("更新后的选中项：", this.defaultCheckedKeys);
        },
        getAllNodeCount(nodes) {
            let count = 0;
            nodes.forEach(node => {
                count++;
                if (node.children) {
                    count += this.getAllNodeCount(node.children);
                }
            });
            return count;
        },
        checkAll() {
    if (this.checktree) {
        this.defaultCheckedKeys = [1, 2, 3, 4, 5, 6, 7];
    } else {
        this.defaultCheckedKeys = [];
    }
    this.$refs.tree.setCheckedKeys(this.defaultCheckedKeys); // 使用 setCheckedKeys
},
        cmslocation() {

            this.cmclocation = true
        },
        drawLine1() {
            // 基于准备好的dom，初始化echarts实例
            this.myChart2 = this.$echarts.init(document.getElementById('myChart2'))
            // 绘制图表
            this.myChart2.setOption({
                title: {
                    text: '', // 主标题
                    subtext: '', // 副标题
                    x: 'left' // x轴方向对齐方式
                },
                tooltip: {
                    trigger: 'axis' // axis   item   none三个值
                },
                xAxis: {
                    type: 'category', // 还有其他的type，可以去官网喵两眼哦
                    data: this.xline, // x轴数据
                    name: '位置（m）' // x轴名称

                },
                yAxis: {
                    type: 'value',
                    name: 'POD' // 

                },
                legend: {
                    orient: 'vertical',
                    x: 'center',
                    y: 'top',
                    data: ['POD']
                },
                series: [
                    {
                        name: 'POD',
                        data: this.yline,
                        type: 'line'
                    }
                ]
            })
        }
    },
    created() {
        this.GetCard()
        this.GetTaskAuto()
        this.GetTaskDefaultParameter()
        this.GetTaskAnalyzeAllDistanceFinding()
        this.GetDataModels()
    }

}
</script>
<style lang="less">
.tof_tasklist {
    background: #1f2935;
    width: 100%;
    height: 100%;
    float: left;

}

.el-table--border .el-table__cell .cell {
    text-align: center;
}

.fovdata {
    width: @w * 480vw;
    float: left;
}

.el-table tr {
    color: #fff;
}

.is-current {
    color: #FFF;
    background-color: #ffA500 !important;
}

.el-tree-node__content:hover {
    color: #FFF;
    background-color: #ffA500
}

.el-tree-node:focus>.el-tree-node__content {
    color: #FFF;
    background-color: #ffA500
}

.el-table__row:hover {
    color: #333;
    // background-color: #ffA500 !important;
}

// .left_side .test_list .el-radio-button__orig-radio:checked+.el-radio-button__inner {
//     color: #FFF;
//     background-color: #ffA500 !important;
// }

.el-dialog {
    background-color: #262626 !important;
    color: #ccc;
    /*color: #ccc;*/
}

.el-dialog__title {
    color: #cccccc;
}

.left_side_bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    width: @w * 400vw;
    height: @h*100vh;

    .el-button {
        width: @w * 100vw;
        margin: 0 @w * 10vw;
        padding: @h*10vh @w * 10vw;
    }
}

.left_side {
    float: left;
    background: #1F2935;
    width: @w * 200vw;
    height: @h*920vh;
    border-left: 1px solid #999;
    border-right: 1px solid #999;

    .el-checkbox__label {
        font-size: @h*30vh !important;
    }

    .el-tree-node__label {
        font-size: @h*20vh !important;
    }

    .el-tree-node__content {
        height: @h*50vh;
        line-height: @h*50vh;
        // font-size: @h*30vh;
    }

    .title {
        height: @h*50vh;
        line-height: @h*50vh;
        font-size: @h*30vh;
        padding: 0 @w * 20vw;
        float: left;
        text-align: center;
        color: #fff;
    }

    .test_list {
        float: left;
        margin-top: @h*10vh;
        width: 100%;
        background: #1F2935;
        color: #fff;

        .el-radio-button__inner {
            background: #1F2935;
            border: none;
            font-weight: 500;
            color: #fff;
            padding: 0 @w * 15vw;
            font-size: @h*24vh;
            border-radius: 0;
            width: @w * 198vw;
            text-align: left;
            height: @h*60vh;
            line-height: @h*60vh;
        }

        .el-radio-button__orig-radio:checked+.el-radio-button__inner {
            color: #FFF;
            background-color: #161D26;
        }

    }

}

.right_bottom {
    background: #1F2935;
    height: @h*75vh;
    float: left;
    width: @w * 1920vw;
    margin-top: @h * 5vh;

    .title {
        height: @h*75vh;
        line-height: @h*75vh;
        font-size: @h*20vh;
        margin: 0 @w * 15vw;
    }

    .el-select {
        margin: @h * 15vh @w * 5vw;
        width: @w * 100vw;
    }

    .fr {
        float: right;
    }

    .el-button {
        margin: @h * 15vh @w * 20vw;
    }
}

.center_side {
    float: left;
    width: @w * 300vw;
    height: @h * 920vh;

    .testitem_double {
        height: @h * 150vh;
        margin: @h * 5vh 0 0 @w * 10vw;

        // height: @h * 1vh;

    }

    .testitem {
        font-size: @h * 16vh;
        margin: @h * 5vh 0 @h * 5vh @w * 10vw;
        height: @h * 50vh;

        .span_title {
            float: left;
            line-height: @h * 50vh;
            width: @w * 150vw !important;
        }
    }

    .el-select__caret {
        line-height: @w * 60vh;
    }

    .el-input {
        width: @w * 120vw;
        float: left;

        .el-input__inner {
            margin: @h * 8vh 0;
            height: @w * 60vh;
            line-height: @w * 60vh;
            width: @w * 120vw;
            font-size: @h * 16vh;
        }

    }

}

.right_side {
    float: left;
    // background: #1F2935;
    width: @w * 1400vw;
    margin-left: @w * 10vw;
    height: @w * 818vw;
    overflow: auto;

    .title {
        height: @h*30vh;
        line-height: @h*30vh;
        font-size: @h*20vh;
        padding: 0 @w * 20vw @h * 10vh @w * 20vw;
        float: left;
    }

    .tablefov {
        float: left;
        margin: @h*10vh @w * 10vw;
        width: @w * 350vw;
        background-color: #161D26;

        .el-table__cell {
            background-color: #161D26;
            height: @h * 50vh
        }
    }

    .right_top {

        height: @h*480vh;
        margin: @h * 15vh 0 0 0;
        float: left;

        .test_echat {
            // background: #1F2935;
            float: left;
            width: @w * 960vw;
            height: 100%;

            .echat_inner {
                background: #1F2935;
                width: @w * 960vw;
                height: @h*430vh;
                float: left;

                .chart-container {
                    width: 100%;
                    height: 400px;
                }
            }
        }

        .test_table {
            margin: 0 0 0 @w * 20vw;
            // background: #1F2935;
            float: left;
            width: @w * 400vw;
            // height: 600%;

            .table_inner {
                width: @w * 400vw;
                height: @h*430vh;
                background: #1F2935;
                float: left;

                img {
                    margin: @h*15vh @w * 25vw;
                    width: @w * 350vw;
                }

                .el-table__row:hover {
                    color: #fff;
                    // background-color: #ffA500 !important;
                }

                .el-table {
                    width: 93% !important;
                    // width: 50% !important;
                    text-align: center;
                    margin: @h*15vh @w * 15vw;
                }

                .el-table thead {
                    color: #fff;

                }

                .el-table tr {
                    background: #1F2935;
                }

                .el-table__cell {
                    padding: @h*6vh 0
                }

                .el-table td.el-table__cell,
                .el-table th.el-table__cell.is-leaf {
                    background: #161D26;

                }

            }
        }



    }

    .right_img {
        margin: @h * 10vh 0;
        float: left;
        width: @w * 350vw;
    }

    .right_result {
        height: @h * 400vh;
        margin: @h * 10vh 0;
        width: @w * 980vw;
        float: left;

        .el-table {
            background-color: #161D26;

            //  border: #161D26;
            thead {
                color: #fff;
                // background-color: #fff;
            }

            .el-table__cell {
                background-color: #161D26;
            }
        }

        .result_inner {
            .el-table thead.is-group th.el-table__cell {
                text-align: center;
            }

            width: @w * 960vw;
            height: @h*370vh;
            background: #1F2935;
            float: left;

            .both_title {
                width: @w * 960vw;
                height: @h*55vh;
                line-height: @h*55vh;

                span {
                    font-size: @h*16vh;
                    text-align: center;
                    width: @w * 480vw;
                    float: left;
                }

            }

            .number {
                position: relative;
                /* 使用相对定位 */
                top: 20px;
                /* 向下移动字体 */
                margin-left: 46px;
                /* 左边空格 */
                font-size: 40px;
                /* 字体变大 */
                color: green;
                /* 字体变绿色 */
            }
        }

        .additional-text {
            position: relative;
            /* 使用相对定位 */
            top: 20px;
            /* 向下移动字体 */
            margin-top: 10px;
            margin-left: 33px;
            /* 给下一行文字一些空间 */
            font-size: 16px;
            /* 字体大小 */
        }

    }


}
</style>